//Accepted
//http://codeforces.com/problemset/problem/92/B
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <iostream>
#include <list>
#include <deque>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;

char s[1000009];
int n, x, i, j;
int main (){
	//freopen("in.txt", "r", stdin);//freopen("out.txt", "w", stdout);
	scanf("%s", s);
	n=strlen(s);
	
	x=0;
	for(i=n-1;i>0;++x){
		if(s[i]=='0')--i;
		else{
			for(j=i;j>-1;--j){
				if(s[j]=='0'){
					s[j]='1';
					break;
				}else s[j]='0';
			}
		}
	}
	if(s[0]=='0')++x;
	printf("%d", x);
	return 0;
}
